ah202's Avatar
  • Welcome, ah202
  • Last Visit Date: Today
  • Page:
  • 1

TOPIC: SQL error on site logout

SQL error on site logout 1 week 2 days ago #257166

  • ah202
  • ah202
  • ONLINE
  • Fresh Boarder
    Fresh Boarder
  • Posts: 6
  • Karma: -
Hi,

I have installed Community builder to interact with another plugin (Joomdle) that exports user Data onto another website upon registration in Joomla.

I have added the CB login module onto my site homepage, and removed the default Joomla login form module.

I am experiencing an issue when logging out of the site. When any user logs out more than once in the same session taken to the following page:

/index.php/cb-logout/logout

An SQL database error is then displayed on the page as below, the rest of the page is blank:

Duplicate entry '' for key 'PRIMARY' SQL=INSERT INTO `jos_session` (`session_id`, `client_id`, `guest`, `time`, `userid`, `username`) VALUES ('', 0, 1, '0', 0, '')

The issue resolves itself once I disable the CB plugin and re-enable the default login form.

I have done some investigation into this and can see that the 'Jos_session' table in the Joomla database appears to not be cleared down properly after the first logout, Leaving a row with a blank session ID. I have attached the contents of Jos_session after login for the first time and after the second time for comparison.


I am running

Joomla 3.3.6 stable
CB 2.0.4
PHP 5.4.34
MYSQL 5.1

If you need anything else to help troubleshoot let me know.

Can you advise on how I can resolve this issue? Thanks.
Attachments:

SQL error on site logout 1 week 2 days ago #257204

  • krileon
  • krileon
  • ONLINE
  • Administrator
    Administrator
  • Posts: 39702
  • Karma: 1111
Empty your _session table then see if issue comes up again. I've no idea why something is trying to manually insert a session row. CB doesn't do any inserts directly to _session. We use Joomla session API directly. On logout CB clears the session and resets is the same way Joomla does, which re-establishes a guest session on logout. No session should have an empty key. My guess is whatever you're using to interact between CB and Joomdle is likely causing this; especially if it's trying to do some behavior on login/logout.
Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Tutorials + Search the forums
CB links: Documentation - Tutorials - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Advanced, Professional, Developer, or CBSubs subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Advanced, Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
--
If you use Community Builder, please post a rating and a review at the Joomla! Extensions Directory.
Last Edit: 1 week 2 days ago by krileon. Report to moderator

SQL error on site logout 1 week 2 days ago #257214

  • ah202
  • ah202
  • ONLINE
  • Fresh Boarder
    Fresh Boarder
  • Posts: 6
  • Karma: -
Hi,

Sorry I should have mentioned this in the original reply but i've already cleared the jos_session table by truncating the table, this stops the error occuring on the next logout, but the issue then re-appears.

I have the query log for login/logout, I can see the offending SQL:

FROM `jos_session`
WHERE `session_id` = '' LIMIT 0, 1
74 Query INSERT INTO `jos_session`
(`session_id`, `client_id`, `time`) VALUES
('', 0, '1417444365')
74 Query UPDATE `jos_session`
SET `data` = '__default|a:2:{s:22:\"session.client.browser\";s:108:\"Mozilla/5 .0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0. 2171.95 Safari/537.36\";s:15:\"session.counter\";i:1;}'
, `time` = '1417444365'


If this is not CB inserting this data then I'm not sure what is, as this issue disappears when I remove CB login, can you suggest how I might troubleshoot this further? Thanks

The full query log for the logout operation is attached.
Attachments:
Last Edit: 1 week 2 days ago by ah202. Report to moderator

SQL error on site logout 1 week 2 days ago #257218

  • krileon
  • krileon
  • ONLINE
  • Administrator
    Administrator
  • Posts: 39702
  • Karma: 1111
Your invalid insert is directly after the jmoodle extension has loaded. See the below.

74 Query     SELECT extension_id AS id, element AS "option"                                                                                                                       , params, enabled
FROM jos_extensions
WHERE `type` = 'component' AND `element` = 'com_joomdle'
 
 74 Query     SELECT `data`
FROM `jos_session`
WHERE `session_id` = ''
 
74 Query     SELECT `session_id`
FROM `jos_session`
WHERE `session_id` = '' LIMIT 0, 1
 
74 Query     INSERT INTO `jos_session`
(`session_id`, `client_id`, `time`) VALUES
('', 0, '1417444365')

jmoodle is loading, then querying for a session with no session id, then inserting one. My guess it's a part of jmoodle behavior. Disable jmoodle extension, empty your session table, then retest to see if the issue persists.
Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Tutorials + Search the forums
CB links: Documentation - Tutorials - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Advanced, Professional, Developer, or CBSubs subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Advanced, Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
--
If you use Community Builder, please post a rating and a review at the Joomla! Extensions Directory.
The following user(s) said Thank You: nant

SQL error on site logout 1 week 1 day ago #257284

  • ah202
  • ah202
  • ONLINE
  • Fresh Boarder
    Fresh Boarder
  • Posts: 6
  • Karma: -
Hi Kyle, Thanks for finding that. Disabling Joomdle does indeed fix this issue. I will raise it with the Joomdle devs to see if they can do anything to fix this.
The following user(s) said Thank You: krileon
  • Page:
  • 1
Time to create page: 0.237 seconds